package com.foton.limiter.construstlimiter.utils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @Author RenPu
 * @Date 2023/9/5 11:30
 * @Version 1.0
 * @Description:
 **/
public class Test {


    public static void main(String[] args) {
        String filePath = "C:\\Users\\12795\\Desktop\\cgbm.txt";
//        try {
//            String content = new String(Files.readAllBytes(Paths.get(filePath)));
//            System.out.println(content);
//        } catch (IOException e) {
//            e.printStackTrace();
//        }
        try {
            Stream<String> lines = Files.lines(Paths.get(filePath));
            List<String> contentList = lines.filter(line -> !line.isEmpty()).collect(Collectors.toList());
            contentList.forEach(System.out::println);
        } catch (IOException e) {
            e.printStackTrace();
        }

    }


}
